package total;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Ques1348 {
	
	public void go(){
		Scanner scan = new Scanner(System.in);
		int n,index,sum,time;
		while(scan.hasNext()){
			time = 0;
			n = scan.nextInt();
			for(int i = 1;i <= n;i++){
				sum = 0;
				index = i;
				while(sum < n){
					sum += index;
					index ++;
				}
				if(sum == n){
					time++;
				}
			}
			System.out.println(time);
		}
	}
	
	public static void main(String[] args) {
		new Ques1348().go();
	}
}
